<?php

/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/12/27 10:44
 * Desc:
 */
class Service_Spot_Ticket_Stock
{
    public function __construct()
    {
    }

    /**
     * 获取门票预订库存限制
     * @param $ticket_info
     * @param $stock
     * @param $use_date
     * @param $params
     * @return number
     */
    public function get_stock_limit($ticket_info, $stock, $use_date, $params = array())
    {
        $card_model     = new Service_Spot_Ticket_StockLimit_Card();
        $order_model     = new Service_Spot_Ticket_StockLimit_Order();
        $card_model->next($order_model);
        $stock = $stock == -1 ? 99 : $stock;
        return $card_model->handle($ticket_info, $stock, $use_date, $params);
    }
}